Skip to content

fix: emit base team-member grant for maintainers#160

Open
c1-dev-bot[bot] wants to merge 1 commit into
mainfrom
fix/team-member-grant-for-maintainers
Open

fix: emit base team-member grant for maintainers#160
c1-dev-bot[bot] wants to merge 1 commit into
mainfrom
fix/team-member-grant-for-maintainers

Conversation

@c1-dev-bot
Copy link
Copy Markdown
Contributor

@c1-dev-bot c1-dev-bot Bot commented May 20, 2026

Summary

  • When a team member holds the maintainer role, GitHub's ListTeamMembersByID API filters them out of role=member results. This caused maintainers to only receive a grant on the maintainer entitlement, never on the base team-member entitlement — under-counting membership.
  • This fix emits an additional teamRoleMember grant for every user returned by the maintainer role query, so all team members appear under the base membership entitlement regardless of their elevated role.
  • Matches GitHub's own model where every maintainer is, by definition, also a team member.

Test plan

  • Verify that syncing a GitHub org with a team containing maintainer-role users now produces grants on both the member and maintainer entitlements for those users
  • Verify that users with only the member role still receive exactly one member grant (no duplicates)
  • Check grant ID uniqueness: maintainer users will have two grants with distinct V1Identifiers (team-grant:<team>:<user>:member and team-grant:<team>:<user>:maintainer)

Fixes: CXH-1513


Automated PR Notice

This PR was automatically created by c1-dev-bot as a potential implementation.

This code requires:

  • Human review of the implementation approach
  • Manual testing to verify correctness
  • Approval from the appropriate team before merging

When a team member holds a non-default role (e.g., maintainer), the
GitHub API filters them out of the member role query. This means
maintainers only received a grant on the maintainer entitlement, never
on the base team-member entitlement, causing under-counted membership.

Now, when processing maintainer role results, we also emit a
team-member grant for each user so the membership view matches
GitHub's own model where every maintainer is also a member.

Fixes: CXH-1513
@c1-dev-bot c1-dev-bot Bot requested a review from a team May 20, 2026 00:30
@linear-code
Copy link
Copy Markdown

linear-code Bot commented May 20, 2026

CXH-1513

@github-actions
Copy link
Copy Markdown
Contributor

Connector PR Review: fix: emit base team-member grant for maintainers

Blocking Issues: 0 | Suggestions: 0 | Threads Resolved: 0
Review mode: full
View review run

Review Summary

This PR adds a synthetic member grant for users returned by the role=maintainer query in Grants(), so that team maintainers are correctly represented as also holding base team membership. The change is small (7 lines), correctly constructs the additional grant using the same pattern and V1Identifier format as the existing grants, and relies on the documented GitHub API behavior where ListTeamMembersByID with role=member excludes maintainers. No issues found.

Security Issues

None found.

Correctness Issues

None found.

Suggestions

None.

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No blocking issues found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants